﻿using Farming.Domain.Entities;
using Farming.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Panda.DynamicWebApi;
using Panda.DynamicWebApi.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Farming.Application.Accesst
{
    [DynamicWebApi]
    [ApiExplorerSettings(GroupName = "v1")]
    public class AccesstDataService: IDynamicWebApi
    {
        private readonly IRepository<AccesstInfo> accesstinfoRep;
        public AccesstDataService(IRepository<AccesstInfo> accesstinfoRep)
        {
            this.accesstinfoRep = accesstinfoRep;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public async Task<IList<AccesstInfo>> GetAccesstInfos()
        {
            var list=await accesstinfoRep.GetAllAsync();
            return list;
        }
    }
}
